/*
 * Developer : Jack Matthews
 * Email: developer@droidprofessor.com
 * 
 * Copyright (C) 2010 http://droidprofessor.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.droidprofessor.android.licensegenerator.client;

import com.droidprofessor.android.library.phonelicenses.R;

public enum LicenseType {
	/**
	 * A version of the application with all payment 
	 * methods enabled via the phone.
	 * 
	 * In addition, users can make payments from your website.
	 * 
	 */
	PHONE_PAYMENTS_ENABLED(true, 0, 0),
	
	/**
	 * A version for the Android Market or other markets that do not allow
	 * third party payment systems from the phone.
	 * <br /><br />
	 * This may be because you are unable
	 * to open an Android Market Seller Account.  Users will
	 * be told to go to your website to purchase the application.
	 * <br /><br />
	 * The Android Market does not allow third party payment 
	 * systems, therefore all Payments are disabled.
	 */
	PHONE_PAYMENTS_DISABLED(
			false, 
			R.string.com_phonelicenses_payments_restricted, 
			R.string.com_phonelicenses_payments_restricted_message
			),
			

	/**
	 * This is the version you will put on the Android Market
	 * and expect to receive payments for.
	 * <br /><br />
	 * This version will <b>not</b> be published as FREE
	 * <br /><br />
	 * The Android Market does not allow third party payment 
	 * systems, therefore all Payments are disabled.
	 * <br /><br />
	 * @see LicenseType#ANDROID_MARKET_FREE
	 * 
	 */
	ANDROID_MARKET_PAID(
			true, 
			R.string.com_phonelicenses_android_market_free_version, 
			R.string.com_phonelicenses_android_market_free_version_message
			),
	
			
			
	/**
	 * A version for the Android Market.
	 * <br /><br />
	 * Use a Free version if you would like your users to trial
	 * your software. This cannot be a time-expiry trial as the 
	 * Android Market does allow this in their terms and conditions.
	 * <br /><br />
	 * You will have to create a separate licensing application
	 * if you want users to be able to unlock features.
	 * <br /><br />
	 * The user will be told to buy the licensing application from the 
	 * Android Market.
	 * <br /><br />
	 * The Android Market does not allow third party payment 
	 * systems, therefore all Payments are disabled.
	 * <br /><br />
	 * This version will be published as FREE
	 * 
	 */			
	ANDROID_MARKET_FREE(
			false, 
			R.string.com_phonelicenses_android_market_free_version, 
			R.string.com_phonelicenses_android_market_free_version_message
			),
			
	/**
	 * No license in effect (DANGEROUS).
	 * <br /><br />
	 * This version is fully operational.
	 * Any license checks will return true, even if there is no 
	 * license installed at the time.
	 * 
	 * This may be useful for some more exotic markets that
	 * do not allow you to sell using your own payment
	 * system.
	 * 
	 */
	DISABLE_LICENSE (
			false, 
			R.string.com_phonelicenses_full_version, 
			R.string.com_phonelicenses_full_version_message
	);
	
	
	private final int header;
	private final int body;
	private final boolean canPay;
	
	LicenseType(boolean canPay, int header, int body) {
		this.header = header;
		this.body = body;
		this.canPay = canPay;
	}
	
	public boolean canPay() {
		return this.canPay;
	}

	public int getBodyMessage() {
		return this.body;
	}

	public int getHeaderMessage() {
		return this.header;
	}
}
